from selenium.webdriver.common.by import By
from pages.base_page import BasePage
import allure
import logging

logger = logging.getLogger(__name__)

class RegisterPage(BasePage):
    """首页页面对象"""
    # 页面元素定位器（元组格式：(定位方式, 定位值)）
    register_log=(By.XPATH,"//p[@class='text-center']")
    user_name=(By.ID,'username')
    stu_id=(By.ID,'name')
    passwd=(By.ID,'password')
    passwd_cfg=(By.ID,'password2')
    register_button=(By.ID,'register_btn')

    def __init__(self, driver):
        super().__init__(driver)
        self.find_element(By.XPATH, "//a[contains(text(),'注册')]").click()

    def click_register_btn(self):
        """点击登录按钮"""
        self.click(*self.register_button)
